using System;
using System.Collections.Generic;
using System.Text;
using DDW.Collections;

namespace DDW
{
	public class ObjectCreationExpression : PrimaryExpression
	{
		public ObjectCreationExpression()
		{
		}
		public ObjectCreationExpression(ExpressionNode type)
		{
			this.type = type;
		}
		public ObjectCreationExpression(ExpressionNode type, ExpressionList argumentList)
		{
			this.type = type;
			this.argumentList = argumentList;
		}

		private ExpressionNode type;
		public ExpressionNode Type
		{
			get { return type; }
			set { type = value; }
		}

		private ExpressionList argumentList;
		public ExpressionList ArgumentList
		{
			get { return argumentList; }
			set { argumentList = value; }
		}

		public override void ToSource(StringBuilder sb)
		{
			sb.Append("new ");
			type.ToSource(sb);
			sb.Append("(");
			argumentList.ToSource(sb);
			sb.Append(")");
		}
	}
}
